﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;

namespace Broker.Model
{
    public class UpdateInfo
    {
        public static UpdateInfo LoadLastUpdateInfo(ISession sess)
        {
            string hql = "from UpdateInfo where Id=(select max(Id) from UpdateInfo)";

            UpdateInfo info = sess.CreateQuery(hql).UniqueResult<UpdateInfo>();

            return info;
        }

        public virtual int Id { get; set; }

        public virtual DateTime CheckTime { get; set; }

        public virtual long ServerTimeStamp { get; set; }

        public virtual long ClientTimeStamp { get; set; }

        public virtual DateTime? UpdateTime { get; set; }
    }
}
